﻿using System.Collections.Generic;
using UnityEngine;

public enum XResType
{
    Texture,
    Prefab,
    TextAsset,
    AudioClip,
}
public class XRes
{
    private static Dictionary<XResType, string> _resType2Name = new Dictionary<XResType, string>() { 
        {XResType.Texture, "pic_" },
        {XResType.Prefab, "pre_" },
        {XResType.TextAsset, "txt_" },
        {XResType.AudioClip, "auc_" },
    };
    public static string N(string rawName, XResType resType)
    {
        string prefix;
        if(!_resType2Name.TryGetValue(resType, out prefix))
        {
            prefix = "";
            Debug.LogError("Can not find resType:" + resType);
        }
        return prefix + rawName;
    }
}
